<template>
  <div class="data-statistics">
    <div class="btntop">
      <i class="el-icon-location-information" />
      {{ allparams.lineName }} {{ allparams.siteName }}
      {{ allparams.pillarNum }}#支柱号 {{ allparams.roadMark }}
    </div>
    <div v-loading="loading" class="value-form">
      <div v-for="i in shownum" :key="i" class="relitem">
        <transverse-child1C v-if="i===1" :params="valuek" :datatime="formdata['1C']?formdata['1C']:[]" />
        <transverse-child2C v-if="i===2" :params="valuek" :datatime="formdata['2C']?formdata['2C']:[]" />
        <transverse-child3C v-if="i===3" :params="valuek" :datatime="formdata['3C']?formdata['3C']:[]" />
        <transverse-child4C v-if="i===4" :params="valuek" :datatime="formdata['4C']?formdata['4C']:[]" />
      </div>
    </div>
  </div>
</template>

<script>
import TransverseChild1C from './transverse-child1C'
import TransverseChild2C from './transverse-child2C'
import TransverseChild3C from './transverse-child3C'
import TransverseChild4C from './transverse-child4C'
import { findLateralAnalysisTime } from '@/api/cms/data-statistics'
export default {
  name: 'DialogTransverse',
  components: {
    TransverseChild1C,
    TransverseChild2C,
    TransverseChild3C,
    TransverseChild4C
  },
  data() {
    return {
      shownum: 4,
      loading: false,
      allparams: {
        line: {},
        lineSite: {},
        pillar: {}
      },
      formdata: {}, // 查询处理的数据
      valuek: {
        deptCode: '', // 所选得供电段
        selectLin: '', // 选择线路
        directionId: '', // 行别
        lineSiteCode: '', // 区间
        pillarNum: '',
        pillarCode: ''
      }
    }
  },
  watch: {
  },
  mounted() {
  },
  methods: {
    getFromvalue(val) {
      this.allparams = val
      this.valuek = val
      this.loading = true
      // this.shownum = 0
      findLateralAnalysisTime(val).then(res => {
        // this.shownum = 4
        this.loading = false
        this.formdata = res.data
      }).catch(_ => {
        // this.shownum = 4
        this.loading = false
      })
    }
  }
}
</script>

<style scoped lang="scss">
.el-loading-parent--relative{
  position: initial!important;
}
</style>
<style scoped lang="scss">
.data-statistics{
  height: 100%;
  padding: 0;
  border: 1px solid #aed0ea;
  .btntop{
    height: 42px;
    line-height: 42px;
    padding-left: 10px;
    font-size: 16px;
    background: #006fc5;
    color: white;
    border-bottom: 1px solid #aed0ea;
  }
  .value-form{
    height: calc(100% - 42px);
  }
}
.el-loading-parent--relative{
  position: initial!important;
}
</style>
